#ifndef _FINGERPRINT_MANAGER_HEAD_H
#define _FINGERPRINT_MANAGER_HEAD_H
#include "Fingerprint-device.h"
#include <thread>
#include <condition_variable>
// 互斥锁
#include <mutex>

using namespace std;

class FingerprintManager
{
public:
    FingerprintManager(FingerPrintDevice *fingerPrintDevice);
    void verfiyFingerPrintTaskRun(void);
    void pauseVerifyFingerPrintTask(void);
    void resumeVerifyFingerPrintTask(void);
    bool recordFingerPrint(const uint16_t pos);
    bool deleteFingerPrint(const uint16_t pos);
    bool clearFingerPrintlib(void);

private:
    FingerPrintDevice *fingerPrintDevice;
    // 指纹比对线程
    thread *verifyLoopThread;
    // 指纹是否暂停的标志
    bool verifyThreadPauseFlag;
    // 条件变量
    condition_variable verifyCond;
    // 互斥锁
    mutex verifyMutex;
};

#endif